package com.lzw.breezeNovel.webApp.controller.common;

import com.lzw.breezeNovel.common.result.Result;
import com.lzw.breezeNovel.webApp.service.common.AdvertisementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.controller
 * @date 2025/3/3
 * @description 广告控制类
 */
@RestController
@RequestMapping("/app/advertisement")
@SuppressWarnings("all")
public class AdvertisementController {

    /**
     * 注入广告服务
     */
    @Autowired
    private AdvertisementService advertisementService;

    /**
     * 根据广告
     */
    @GetMapping("/getAdvertisement")
    public Result<List<String>>getAdvertisement(Integer position){
       List<String> list = advertisementService.getAdvertisementByPosition(position);
       return Result.ok(list);
    }

    /**
     * 根据广告位置获取漫画 漫画广告
     */
    @GetMapping("/getComicAdvertisement")
    public Result<List<String>>getComicAdvertisement(Integer position){
        List<String> list = advertisementService.getComicByPosition(position);
        return Result.ok(list);
    }

    /**
     * 根据广告位置获取视频广告
     */
   @GetMapping("/getVideoAdvertisement")
    public Result<List<String>>getVideoAdvertisement(Integer position){
       List<String> list = advertisementService.getVideoByPosition(position);
       return Result.ok(list);
   }
    /**
     * 获取ai的广告
     */
    @GetMapping("/getAiAdvertisement")
    public Result<List<String>>getAiAdvertisement(Integer position){
       List<String> list = advertisementService.getAiByPosition(position);
       return Result.ok(list);
    }

}
